package com.gmail.mariska.martin.jpa.dao;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.EntityManager;

import com.gmail.mariska.martin.model.User;

public class UserDAO extends GenericDAO<User> {

	public UserDAO(EntityManager em) {
		super(User.class, em);
	}

	public User findUserByEmail(String email) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("email", email);

		return super.findOneResult(User.FIND_BY_EMAIL, parameters);
	}
}